
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>2.2020-01-07-C语言基础教程 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="C语言基础教程">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="2020-01-09-c语言语法基础.html" />
    
    
    <link rel="prev" href="2020-01-07-c语言.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="2.1" >
            
                <span>
            
                    
                    [bigdata]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" data-path="../bigdata/2019-12-30-spark-in-docker.html">
            
                <a href="../bigdata/2019-12-30-spark-in-docker.html">
            
                    
                    1.2019-12-30-spark-in-docker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2" data-path="../bigdata/2019-12-30-spark-RDD.html">
            
                <a href="../bigdata/2019-12-30-spark-RDD.html">
            
                    
                    2.2019-12-30-spark-RDD
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3" data-path="../bigdata/2019-12-31-hadoop-hdfs命令别名.html">
            
                <a href="../bigdata/2019-12-31-hadoop-hdfs命令别名.html">
            
                    
                    3.2019-12-31-hadoop-hdfs命令别名
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2" >
            
                <span>
            
                    
                    [c]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.1" data-path="2020-01-07-c语言.html">
            
                <a href="2020-01-07-c语言.html">
            
                    
                    1.2020-01-07-c语言
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="2.2.2" data-path="2020-01-07-C语言基础教程.html">
            
                <a href="2020-01-07-C语言基础教程.html">
            
                    
                    2.2020-01-07-C语言基础教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.3" data-path="2020-01-09-c语言语法基础.html">
            
                <a href="2020-01-09-c语言语法基础.html">
            
                    
                    3.2020-01-09-c语言语法基础
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.3" >
            
                <span>
            
                    
                    [DataStructureandAlgorithms]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.3.1" data-path="../DataStructureandAlgorithms/2019-12-28-数据结构和算法的关系.html">
            
                <a href="../DataStructureandAlgorithms/2019-12-28-数据结构和算法的关系.html">
            
                    
                    1.2019-12-28-数据结构和算法的关系
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.2" data-path="../DataStructureandAlgorithms/2019-12-28-稀疏数组.html">
            
                <a href="../DataStructureandAlgorithms/2019-12-28-稀疏数组.html">
            
                    
                    2.2019-12-28-稀疏数组
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.4" >
            
                <span>
            
                    
                    [git]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.4.1" data-path="../git/2019-12-28-git-alias.html">
            
                <a href="../git/2019-12-28-git-alias.html">
            
                    
                    1.2019-12-28-git-alias
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4.2" data-path="../git/2019-12-29-git常用命令.html">
            
                <a href="../git/2019-12-29-git常用命令.html">
            
                    
                    2.2019-12-29-git常用命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4.3" data-path="../git/2019-12-31-git教程.html">
            
                <a href="../git/2019-12-31-git教程.html">
            
                    
                    3.2019-12-31-git教程
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.5" >
            
                <span>
            
                    
                    [go]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.5.1" data-path="../go/2019-12-30-beego基本使用.html">
            
                <a href="../go/2019-12-30-beego基本使用.html">
            
                    
                    1.2019-12-30-beego基本使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.6" >
            
                <span>
            
                    
                    [java]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.6.1" data-path="../java/2019-12-30-环境变量和系统属性.html">
            
                <a href="../java/2019-12-30-环境变量和系统属性.html">
            
                    
                    1.2019-12-30-环境变量和系统属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.2" data-path="../java/2019-12-31-cloud-native-云原生.html">
            
                <a href="../java/2019-12-31-cloud-native-云原生.html">
            
                    
                    2.2019-12-31-cloud-native-云原生
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.3" data-path="../java/2019-12-31-java语法难点.html">
            
                <a href="../java/2019-12-31-java语法难点.html">
            
                    
                    3.2019-12-31-java语法难点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.4" data-path="../java/2019-12-31-设计模式.html">
            
                <a href="../java/2019-12-31-设计模式.html">
            
                    
                    4.2019-12-31-设计模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.5" data-path="../java/2020-01-12-Ajax跨域问题解决方案.html">
            
                <a href="../java/2020-01-12-Ajax跨域问题解决方案.html">
            
                    
                    5.2020-01-12-Ajax跨域问题解决方案
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.6" data-path="../java/2020-01-12-freemarker应用场景介绍.html">
            
                <a href="../java/2020-01-12-freemarker应用场景介绍.html">
            
                    
                    6.2020-01-12-freemarker应用场景介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.7" data-path="../java/2020-01-12-jsp运行原理和运行过程.html">
            
                <a href="../java/2020-01-12-jsp运行原理和运行过程.html">
            
                    
                    7.2020-01-12-jsp运行原理和运行过程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.8" data-path="../java/2020-01-12-深入理解Maven中的Profile.html">
            
                <a href="../java/2020-01-12-深入理解Maven中的Profile.html">
            
                    
                    8.2020-01-12-深入理解Maven中的Profile
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.9" data-path="../java/2020-01-12-缓存穿透-缓存击穿-缓存雪崩概念及解决方案.html">
            
                <a href="../java/2020-01-12-缓存穿透-缓存击穿-缓存雪崩概念及解决方案.html">
            
                    
                    9.2020-01-12-缓存穿透-缓存击穿-缓存雪崩概念及解决方案
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.10" data-path="../java/2020-01-13-事务笔记.html">
            
                <a href="../java/2020-01-13-事务笔记.html">
            
                    
                    10.2020-01-13-事务笔记
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.11" data-path="../java/2020-01-13-幂等性.html">
            
                <a href="../java/2020-01-13-幂等性.html">
            
                    
                    11.2020-01-13-幂等性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.12" data-path="../java/2020-01-16-java基本语法.html">
            
                <a href="../java/2020-01-16-java基本语法.html">
            
                    
                    12.2020-01-16-java基本语法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.7" >
            
                <span>
            
                    
                    [arthas]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.7.1" data-path="../java/arthas/2019-12-28-arthas-example.html">
            
                <a href="../java/arthas/2019-12-28-arthas-example.html">
            
                    
                    1.2019-12-28-arthas-example
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.2" data-path="../java/arthas/2019-12-28-arthas添加支持执行历史命令的shell功能.html">
            
                <a href="../java/arthas/2019-12-28-arthas添加支持执行历史命令的shell功能.html">
            
                    
                    2.2019-12-28-arthas添加支持执行历史命令的shell功能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.3" data-path="../java/arthas/2020-01-10-思考性能调优.html">
            
                <a href="../java/arthas/2020-01-10-思考性能调优.html">
            
                    
                    3.2020-01-10-思考性能调优
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.4" data-path="../java/arthas/2020-01-10-性能调优举例-最佳实践.html">
            
                <a href="../java/arthas/2020-01-10-性能调优举例-最佳实践.html">
            
                    
                    4.2020-01-10-性能调优举例-最佳实践
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.5" data-path="../java/arthas/2020-01-10-性能调优举例一.html">
            
                <a href="../java/arthas/2020-01-10-性能调优举例一.html">
            
                    
                    5.2020-01-10-性能调优举例一
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.6" data-path="../java/arthas/2020-01-10-性能调优举例三.html">
            
                <a href="../java/arthas/2020-01-10-性能调优举例三.html">
            
                    
                    6.2020-01-10-性能调优举例三
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.7" data-path="../java/arthas/2020-01-10-性能调优举例二.html">
            
                <a href="../java/arthas/2020-01-10-性能调优举例二.html">
            
                    
                    7.2020-01-10-性能调优举例二
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.8" data-path="../java/arthas/2020-01-10-性能调优举例四.html">
            
                <a href="../java/arthas/2020-01-10-性能调优举例四.html">
            
                    
                    8.2020-01-10-性能调优举例四
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.9" data-path="../java/arthas/2020-01-15-性能调优举例五.html">
            
                <a href="../java/arthas/2020-01-15-性能调优举例五.html">
            
                    
                    9.2020-01-15-性能调优举例五
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.10" data-path="../java/arthas/2020-05-12-性能调优举例六.html">
            
                <a href="../java/arthas/2020-05-12-性能调优举例六.html">
            
                    
                    10.2020-05-12-性能调优举例六
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.11" data-path="../java/arthas/arthas-mind-map.html">
            
                <a href="../java/arthas/arthas-mind-map.html">
            
                    
                    11.arthas-mind-map
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.8" >
            
                <span>
            
                    
                    [dubbo]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.8.1" data-path="../java/dubbo/2019-12-28-dubbo涉及的技术.html">
            
                <a href="../java/dubbo/2019-12-28-dubbo涉及的技术.html">
            
                    
                    1.2019-12-28-dubbo涉及的技术
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.8.2" data-path="../java/dubbo/2019-12-30-dubbo消费者访问流程.html">
            
                <a href="../java/dubbo/2019-12-30-dubbo消费者访问流程.html">
            
                    
                    2.2019-12-30-dubbo消费者访问流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.8.3" data-path="../java/dubbo/2019-12-30-dubbo面试.html">
            
                <a href="../java/dubbo/2019-12-30-dubbo面试.html">
            
                    
                    3.2019-12-30-dubbo面试
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.9" >
            
                <span>
            
                    
                    [jdk]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.9.1" data-path="../java/jdk/2020-01-12-实例介绍 JAVA 泛型基础.html">
            
                <a href="../java/jdk/2020-01-12-实例介绍 JAVA 泛型基础.html">
            
                    
                    1.2020-01-12-实例介绍 JAVA 泛型基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.9.2" data-path="../java/jdk/2020-01-13-ThreadLocal六连问.html">
            
                <a href="../java/jdk/2020-01-13-ThreadLocal六连问.html">
            
                    
                    2.2020-01-13-ThreadLocal六连问
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.10" >
            
                <span>
            
                    
                    [jvm]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.10.1" data-path="../java/jvm/2019-12-30-性能调优.html">
            
                <a href="../java/jvm/2019-12-30-性能调优.html">
            
                    
                    1.2019-12-30-性能调优
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.11" >
            
                <span>
            
                    
                    [netty]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.11.1" data-path="../java/netty/2020-01-16-netty入门.html">
            
                <a href="../java/netty/2020-01-16-netty入门.html">
            
                    
                    1.2020-01-16-netty入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.11.2" data-path="../java/netty/2020-01-16-netty核心概念.html">
            
                <a href="../java/netty/2020-01-16-netty核心概念.html">
            
                    
                    2.2020-01-16-netty核心概念
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.12" >
            
                <span>
            
                    
                    [solr]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.12.1" data-path="../java/solr/2019-12-28-solr-7.6.0.tgz安装.html">
            
                <a href="../java/solr/2019-12-28-solr-7.6.0.tgz安装.html">
            
                    
                    1.2019-12-28-solr-7.6.0.tgz安装
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.13" >
            
                <span>
            
                    
                    [spring]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.13.1" data-path="../java/spring/2020-01-12-SpringBoot属性读取方式介绍.html">
            
                <a href="../java/spring/2020-01-12-SpringBoot属性读取方式介绍.html">
            
                    
                    1.2020-01-12-SpringBoot属性读取方式介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.13.2" data-path="../java/spring/2020-01-12-使用spring boot+mybatis plus快速入门.html">
            
                <a href="../java/spring/2020-01-12-使用spring boot+mybatis plus快速入门.html">
            
                    
                    2.2020-01-12-使用spring boot+mybatis plus快速入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.13.3" data-path="../java/spring/2020-01-13-spring-initMethod-destoryMethod.html">
            
                <a href="../java/spring/2020-01-13-spring-initMethod-destoryMethod.html">
            
                    
                    3.2020-01-13-spring-initMethod-destoryMethod
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.13.4" data-path="../java/spring/2020-01-13-spring循环依赖.html">
            
                <a href="../java/spring/2020-01-13-spring循环依赖.html">
            
                    
                    4.2020-01-13-spring循环依赖
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.13.5" data-path="../java/spring/2020-01-13-spring源码随记.html">
            
                <a href="../java/spring/2020-01-13-spring源码随记.html">
            
                    
                    5.2020-01-13-spring源码随记
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.13.6" data-path="../java/spring/2020-01-13-自定义mini-spring.html">
            
                <a href="../java/spring/2020-01-13-自定义mini-spring.html">
            
                    
                    6.2020-01-13-自定义mini-spring
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.14" >
            
                <span>
            
                    
                    [websocket]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.14.1" data-path="../java/websocket/2019-12-30-webscoket-springboot通信.html">
            
                <a href="../java/websocket/2019-12-30-webscoket-springboot通信.html">
            
                    
                    1.2019-12-30-webscoket-springboot通信
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.15" >
            
                <span>
            
                    
                    [linux]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.15.1" data-path="../linux/2019-12-28-Linux常用命令和快捷键.html">
            
                <a href="../linux/2019-12-28-Linux常用命令和快捷键.html">
            
                    
                    1.2019-12-28-Linux常用命令和快捷键
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.2" data-path="../linux/2019-12-28-从零到一环境安装.html">
            
                <a href="../linux/2019-12-28-从零到一环境安装.html">
            
                    
                    2.2019-12-28-从零到一环境安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.3" data-path="../linux/2019-12-30-vi-常用命令.html">
            
                <a href="../linux/2019-12-30-vi-常用命令.html">
            
                    
                    3.2019-12-30-vi-常用命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.4" data-path="../linux/2019-12-31-awk命令.html">
            
                <a href="../linux/2019-12-31-awk命令.html">
            
                    
                    4.2019-12-31-awk命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.5" data-path="../linux/2019-12-31-cup信息分析.html">
            
                <a href="../linux/2019-12-31-cup信息分析.html">
            
                    
                    5.2019-12-31-cup信息分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.6" data-path="../linux/2019-12-31-shell编程.html">
            
                <a href="../linux/2019-12-31-shell编程.html">
            
                    
                    6.2019-12-31-shell编程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.7" data-path="../linux/2019-12-31-top命令.html">
            
                <a href="../linux/2019-12-31-top命令.html">
            
                    
                    7.2019-12-31-top命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.8" data-path="../linux/2019-12-31-普通用户docker的问题.html">
            
                <a href="../linux/2019-12-31-普通用户docker的问题.html">
            
                    
                    8.2019-12-31-普通用户docker的问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.9" data-path="../linux/2020-01-01-centos7 安装kubernetes.html">
            
                <a href="../linux/2020-01-01-centos7 安装kubernetes.html">
            
                    
                    9.2020-01-01-centos7 安装kubernetes
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.10" data-path="../linux/2020-01-01-centos安装常用配置.html">
            
                <a href="../linux/2020-01-01-centos安装常用配置.html">
            
                    
                    10.2020-01-01-centos安装常用配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.11" data-path="../linux/2020-01-01-docker使用.html">
            
                <a href="../linux/2020-01-01-docker使用.html">
            
                    
                    11.2020-01-01-docker使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.12" data-path="../linux/2020-01-01-kubernetes使用.html">
            
                <a href="../linux/2020-01-01-kubernetes使用.html">
            
                    
                    12.2020-01-01-kubernetes使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.13" data-path="../linux/2020-05-12-PG有用的SQL.html">
            
                <a href="../linux/2020-05-12-PG有用的SQL.html">
            
                    
                    13.2020-05-12-PG有用的SQL
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.14" data-path="../linux/2020-05-12-vim命令.html">
            
                <a href="../linux/2020-05-12-vim命令.html">
            
                    
                    14.2020-05-12-vim命令
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.16" >
            
                <span>
            
                    
                    [automate]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.16.1" data-path="../linux/automate/2020-01-12-redis伪集群创建脚本.html">
            
                <a href="../linux/automate/2020-01-12-redis伪集群创建脚本.html">
            
                    
                    1.2020-01-12-redis伪集群创建脚本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.16.2" data-path="../linux/automate/2020-01-12-tomcat集群创建脚本.html">
            
                <a href="../linux/automate/2020-01-12-tomcat集群创建脚本.html">
            
                    
                    2.2020-01-12-tomcat集群创建脚本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.16.3" data-path="../linux/automate/2020-01-12-zookeeper自动化脚本.html">
            
                <a href="../linux/automate/2020-01-12-zookeeper自动化脚本.html">
            
                    
                    3.2020-01-12-zookeeper自动化脚本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.16.4" data-path="../linux/automate/2020-01-12-其他自动化脚本.html">
            
                <a href="../linux/automate/2020-01-12-其他自动化脚本.html">
            
                    
                    4.2020-01-12-其他自动化脚本
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.17" >
            
                <span>
            
                    
                    [MySQL]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.17.1" data-path="../MySQL/2019-12-31-mysql常用命令.html">
            
                <a href="../MySQL/2019-12-31-mysql常用命令.html">
            
                    
                    1.2019-12-31-mysql常用命令
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.18" >
            
                <span>
            
                    
                    [nginx]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.18.1" data-path="../nginx/2019-12-29-Nginx-Keepalived高可用集群.html">
            
                <a href="../nginx/2019-12-29-Nginx-Keepalived高可用集群.html">
            
                    
                    1.2019-12-29-Nginx-Keepalived高可用集群
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.18.2" data-path="../nginx/2020-01-16-nginx参数详细说明.html">
            
                <a href="../nginx/2020-01-16-nginx参数详细说明.html">
            
                    
                    2.2020-01-16-nginx参数详细说明
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.19" >
            
                <span>
            
                    
                    [other]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.19.1" data-path="../other/2019-12-28-知识小计.html">
            
                <a href="../other/2019-12-28-知识小计.html">
            
                    
                    1.2019-12-28-知识小计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.19.2" data-path="../other/2020-01-04-科学上网.html">
            
                <a href="../other/2020-01-04-科学上网.html">
            
                    
                    2.2020-01-04-科学上网
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.19.3" data-path="../other/2020-05-13-正则表达式.html">
            
                <a href="../other/2020-05-13-正则表达式.html">
            
                    
                    3.2020-05-13-正则表达式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.19.4" data-path="../other/template.html">
            
                <a href="../other/template.html">
            
                    
                    4.template
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.20" >
            
                <span>
            
                    
                    [PostgreSQL]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.20.1" data-path="../PostgreSQL/2019-12-28-PostgreSQL安装文档.html">
            
                <a href="../PostgreSQL/2019-12-28-PostgreSQL安装文档.html">
            
                    
                    1.2019-12-28-PostgreSQL安装文档
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.20.2" data-path="../PostgreSQL/2019-12-28-Postgres学习笔记.html">
            
                <a href="../PostgreSQL/2019-12-28-Postgres学习笔记.html">
            
                    
                    2.2019-12-28-Postgres学习笔记
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.20.3" data-path="../PostgreSQL/2019-12-28-脚本MYSQL导出数据到PG.html">
            
                <a href="../PostgreSQL/2019-12-28-脚本MYSQL导出数据到PG.html">
            
                    
                    3.2019-12-28-脚本MYSQL导出数据到PG
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.20.4" data-path="../PostgreSQL/2020-01-04-docker-PostgreSQL安装文档.html">
            
                <a href="../PostgreSQL/2020-01-04-docker-PostgreSQL安装文档.html">
            
                    
                    4.2020-01-04-docker-PostgreSQL安装文档
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.20.5" data-path="../PostgreSQL/2020-01-17-阿里云PG主从切换问题.html">
            
                <a href="../PostgreSQL/2020-01-17-阿里云PG主从切换问题.html">
            
                    
                    5.2020-01-17-阿里云PG主从切换问题
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.21" >
            
                <span>
            
                    
                    [python]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.21.1" data-path="../python/2019-12-28-pip-install指定国内源镜像.html">
            
                <a href="../python/2019-12-28-pip-install指定国内源镜像.html">
            
                    
                    1.2019-12-28-pip-install指定国内源镜像
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.21.2" data-path="../python/2019-12-30-python内置函数.html">
            
                <a href="../python/2019-12-30-python内置函数.html">
            
                    
                    2.2019-12-30-python内置函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.21.3" data-path="../python/2019-12-30-一图搞懂基本python语法 .html">
            
                <a href="../python/2019-12-30-一图搞懂基本python语法 .html">
            
                    
                    3.2019-12-30-一图搞懂基本python语法 
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.22" >
            
                <span>
            
                    
                    [redis]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.22.1" data-path="../redis/2019-12-28-redis5.0.3安装.html">
            
                <a href="../redis/2019-12-28-redis5.0.3安装.html">
            
                    
                    1.2019-12-28-redis5.0.3安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.22.2" data-path="../redis/2019-12-28-redis5.0.3集群搭建.html">
            
                <a href="../redis/2019-12-28-redis5.0.3集群搭建.html">
            
                    
                    2.2019-12-28-redis5.0.3集群搭建
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.23" >
            
                <span>
            
                    
                    [tool]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.23.1" data-path="../tool/2019-12-28-idea高效使用技巧和快捷键.html">
            
                <a href="../tool/2019-12-28-idea高效使用技巧和快捷键.html">
            
                    
                    1.2019-12-28-idea高效使用技巧和快捷键
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.23.2" data-path="../tool/2019-12-28-PlantUML画图脚本.html">
            
                <a href="../tool/2019-12-28-PlantUML画图脚本.html">
            
                    
                    2.2019-12-28-PlantUML画图脚本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.23.3" data-path="../tool/2019-12-30-vscode高效使用.html">
            
                <a href="../tool/2019-12-30-vscode高效使用.html">
            
                    
                    3.2019-12-30-vscode高效使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.24" >
            
                <span>
            
                    
                    [windows]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.24.1" data-path="../windows/2020-01-12-本地服务成为互联网服务.html">
            
                <a href="../windows/2020-01-12-本地服务成为互联网服务.html">
            
                    
                    1.2020-01-12-本地服务成为互联网服务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.24.2" data-path="../windows/2020-01-12-注册bat为windows服务.html">
            
                <a href="../windows/2020-01-12-注册bat为windows服务.html">
            
                    
                    2.2020-01-12-注册bat为windows服务
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >2.2020-01-07-C语言基础教程</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <p>C&#x8BED;&#x8A00;&#x57FA;&#x7840;&#x6559;&#x7A0B;</p>
<h2 id="toc">[TOC]</h2>
<p>&#x53C2;&#x8003;&#xFF1A;C&#x8BED;&#x8A00;&#x6559;&#x7A0B;&#x7F51; <a href="https://www.dotcpp.com/course/c/101101.html" target="_blank">https://www.dotcpp.com/course/c/101101.html</a>
&#x5165;&#x95E8;&#x6559;&#x7A0B;
hello world
&#x6570;&#x503C;&#x3001;&#x5B57;&#x7B26;&#x4E0E;&#x5B57;&#x7B26;&#x4E32;
&#x8FD0;&#x7B97;&#x7B26;&#x53CA;&#x8868;&#x8FBE;&#x5F0F;
&#x9009;&#x62E9;&#x7ED3;&#x6784;&#x4E0E;&#x5FAA;&#x73AF;&#x7ED3;&#x6784;
&#x51FD;&#x6570;&#x57FA;&#x672C;&#x6982;&#x5FF5;&#x53CA;&#x4F5C;&#x7528;&#x57DF;
&#x7F16;&#x8BD1;&#x9884;&#x5904;&#x7406;&#x547D;&#x4EE4;
&#x6570;&#x7EC4;
&#x6307;&#x9488;&#x7684;&#x57FA;&#x672C;&#x6982;&#x5FF5;
&#x6307;&#x9488;&#x4E0E;&#x6570;&#x7EC4;
&#x5B57;&#x7B26;&#x4E32;&#x5904;&#x7406;
&#x8C03;&#x8BD5;&#x4EE5;&#x53CA;&#x8D44;&#x6599;&#x6536;&#x96C6;
&#x7ED3;&#x6784;&#x4F53;
&#x6570;&#x5B66;&#x57FA;&#x7840;
&#x4FE1;&#x606F;&#x5B58;&#x50A8;
CPU&#x5982;&#x4F55;&#x8FDB;&#x884C;&#x6570;&#x5B66;&#x8FD0;&#x7B97;</p>
<h2 id="&#x901A;&#x8FC7;gcc&#x7F16;&#x8BD1;c&#x4EE3;&#x7801;">&#x901A;&#x8FC7;gcc&#x7F16;&#x8BD1;C&#x4EE3;&#x7801;</h2>
<p>gcc&#x7F16;&#x8BD1;&#x5668;&#x4ECB;&#x7ECD;
&#x7F16;&#x8F91;&#x5668;(&#x5982;vi&#x3001;&#x8BB0;&#x4E8B;&#x672C;)&#x662F;&#x6307;&#x6211;&#x7528;&#x5B83;&#x6765;&#x5199;&#x7A0B;&#x5E8F;&#x7684;&#xFF08;&#x7F16;&#x8F91;&#x4EE3;&#x7801;&#xFF09;&#xFF0C;&#x800C;&#x6211;&#x4EEC;&#x5199;&#x7684;&#x4EE3;&#x7801;&#x8BED;
&#x53E5;&#xFF0C;&#x7535;&#x8111;&#x662F;&#x4E0D;&#x61C2;&#x7684;&#xFF0C;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x628A;&#x5B83;&#x8F6C;&#x6210;&#x7535;&#x8111;&#x80FD;&#x61C2;&#x7684;&#x8BED;&#x53E5;&#xFF0C;&#x7F16;&#x8BD1;&#x5668;&#x5C31;&#x662F;&#x8FD9;&#x6837;&#x7684;&#x8F6C;&#x5316;&#x5DE5;
&#x5177;&#x3002;&#x5C31;&#x662F;&#x8BF4;&#xFF0C;&#x6211;&#x4EEC;&#x7528;&#x7F16;&#x8F91;&#x5668;&#x7F16;&#x5199;&#x7A0B;&#x5E8F;&#xFF0C;&#x7531;&#x7F16;&#x8BD1;&#x5668;&#x7F16;&#x8BD1;&#x540E;&#x624D;&#x53EF;&#x4EE5;&#x8FD0;&#x884C;&#xFF01;
&#x7F16;&#x8BD1;&#x5668;&#x662F;&#x5C06;&#x6613;&#x4E8E;&#x7F16;&#x5199;&#x3001;&#x9605;&#x8BFB;&#x548C;&#x7EF4;&#x62A4;&#x7684;&#x9AD8;&#x7EA7;&#x8BA1;&#x7B97;&#x673A;&#x8BED;&#x8A00;&#x7FFB;&#x8BD1;&#x4E3A;&#x8BA1;&#x7B97;&#x673A;&#x80FD;&#x89E3;&#x8BFB;&#x3001;&#x8FD0;&#x884C;&#x7684;
&#x4F4E;&#x7EA7;&#x673A;&#x5668;&#x8BED;&#x8A00;&#x7684;&#x7A0B;&#x5E8F;&#x3002;
gcc&#xFF08;GNU Compiler Collection&#xFF0C;GNU &#x7F16;&#x8BD1;&#x5668;&#x5957;&#x4EF6;&#xFF09;&#xFF0C;&#x662F;&#x7531; GNU &#x5F00;&#x53D1;&#x7684;&#x7F16;&#x7A0B;&#x8BED;&#x8A00;&#x7F16;
&#x8BD1;&#x5668;&#x3002;gcc&#x539F;&#x672C;&#x4F5C;&#x4E3A;GNU&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x7684;&#x5B98;&#x65B9;&#x7F16;&#x8BD1;&#x5668;&#xFF0C;&#x73B0;&#x5DF2;&#x88AB;&#x5927;&#x591A;&#x6570;&#x7C7B;Unix&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;
&#xFF08;&#x5982;Linux&#x3001;BSD&#x3001;Mac OS X&#x7B49;&#xFF09;&#x91C7;&#x7EB3;&#x4E3A;&#x6807;&#x51C6;&#x7684;&#x7F16;&#x8BD1;&#x5668;&#xFF0C;gcc&#x540C;&#x6837;&#x9002;&#x7528;&#x4E8E;&#x5FAE;&#x8F6F;&#x7684;
Windows&#x3002;
gcc&#x6700;&#x521D;&#x7528;&#x4E8E;&#x7F16;&#x8BD1;C&#x8BED;&#x8A00;&#xFF0C;&#x968F;&#x7740;&#x9879;&#x76EE;&#x7684;&#x53D1;&#x5C55;gcc&#x5DF2;&#x7ECF;&#x6210;&#x4E3A;&#x4E86;&#x80FD;&#x591F;&#x7F16;&#x8BD1;C&#x3001;C++&#x3001;Java&#x3001;
Ada&#x3001;fortran&#x3001;Object C&#x3001;Object C++&#x3001;Go&#x8BED;&#x8A00;&#x7684;&#x7F16;&#x8BD1;&#x5668;&#x5927;&#x5BB6;&#x65CF;&#x3002;</p>
<p>&#x7F16;&#x8BD1;&#x547D;&#x4EE4;&#x683C;&#x5F0F;</p>
<pre><code class="lang-text">gcc [-option1] ... &lt;filename&gt;
g++ [-option1] ... &lt;filename&gt;
&#x547D;&#x4EE4;&#x3001;&#x9009;&#x9879;&#x548C;&#x6E90;&#x6587;&#x4EF6;&#x4E4B;&#x95F4;&#x4F7F;&#x7528;&#x7A7A;&#x683C;&#x5206;&#x9694;
&#x4E00;&#x884C;&#x547D;&#x4EE4;&#x4E2D;&#x53EF;&#x4EE5;&#x6709;&#x96F6;&#x4E2A;&#x3001;&#x4E00;&#x4E2A;&#x6216;&#x591A;&#x4E2A;&#x9009;&#x9879;
&#x6587;&#x4EF6;&#x540D;&#x53EF;&#x4EE5;&#x5305;&#x542B;&#x6587;&#x4EF6;&#x7684;&#x7EDD;&#x5BF9;&#x8DEF;&#x5F84;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x76F8;&#x5BF9;&#x8DEF;&#x5F84;
&#x5982;&#x679C;&#x547D;&#x4EE4;&#x4E2D;&#x4E0D;&#x5305;&#x542B;&#x8F93;&#x51FA;&#x53EF;&#x6267;&#x884C;&#x6587;&#x4EF6;&#x7684;&#x6587;&#x4EF6;&#x540D;&#xFF0C;&#x53EF;&#x6267;&#x884C;&#x6587;&#x4EF6;&#x7684;&#x6587;&#x4EF6;&#x540D;&#x4F1A;&#x81EA;&#x52A8;&#x751F;&#x6210;
&#x4E00;&#x4E2A;&#x9ED8;&#x8BA4;&#x540D;&#xFF0C;Linux&#x5E73;&#x53F0;&#x4E3A;a.out&#xFF0C;Windows&#x5E73;&#x53F0;&#x4E3A;a.exe

gcc&#x3001;g++&#x7F16;&#x8BD1;&#x5E38;&#x7528;&#x9009;&#x9879;&#x8BF4;&#x660E;
&#x9009;&#x9879;&#x542B;&#x4E49;
-o file &#x6307;&#x5B9A;&#x751F;&#x6210;&#x7684;&#x8F93;&#x51FA;&#x6587;&#x4EF6;&#x540D;&#x4E3A;file   
-E &#x53EA;&#x8FDB;&#x884C;&#x9884;&#x5904;&#x7406;
-S(&#x5927;&#x5199;) &#x53EA;&#x8FDB;&#x884C;&#x9884;&#x5904;&#x7406;&#x548C;&#x7F16;&#x8BD1;
-c(&#x5C0F;&#x5199;) &#x53EA;&#x8FDB;&#x884C;&#x9884;&#x5904;&#x7406;&#x3001;&#x7F16;&#x8BD1;&#x548C;&#x6C47;&#x7F16;  &#x751F;&#x6210;&#x4E8C;&#x8FDB;&#x5236; .o &#x6587;&#x4EF6;

gcc main.c  &#x7F16;&#x8BD1;&#x751F;&#x6210;a.exe &#x6216; a.out &#x53EF;&#x6267;&#x884C;&#x6587;&#x4EF6;
gcc main.c -o main &#x7F16;&#x8BD1;&#x751F;&#x6210;&#x6307;&#x5B9A;&#x6587;&#x4EF6;&#x540D;main.exe &#x6216;main.out &#x53EF;&#x6267;&#x884C;&#x6587;&#x4EF6;
gcc main.c -E premain.c &#x9884;&#x5904;&#x7406;&#xFF0C;&#x5C31;&#x662F;&#x5C06;&#x6240;&#x6709;&#x7684;&#x5934;&#x6587;&#x4EF6;&#x4FE1;&#x606F;&#x548C;main.c&#x62F7;&#x8D1D;&#x5230;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;premain.c&#x4E2D;
</code></pre>
<h2 id="c&#x4EE3;&#x7801;&#x7F16;&#x8BD1;&#x6210;&#x53EF;&#x6267;&#x884C;&#x7A0B;&#x5E8F;&#x7ECF;&#x8FC7;4&#x6B65;&#xFF1A;">C&#x4EE3;&#x7801;&#x7F16;&#x8BD1;&#x6210;&#x53EF;&#x6267;&#x884C;&#x7A0B;&#x5E8F;&#x7ECF;&#x8FC7;4&#x6B65;&#xFF1A;</h2>
<p>1&#xFF09;&#x9884;&#x5904;&#x7406;&#xFF1A;&#x5B8F;&#x5B9A;&#x4E49;&#x5C55;&#x5F00;&#x3001;&#x5934;&#x6587;&#x4EF6;&#x5C55;&#x5F00;&#x3001;&#x6761;&#x4EF6;&#x7F16;&#x8BD1;&#x7B49;&#xFF0C;&#x540C;&#x65F6;&#x5C06;&#x4EE3;&#x7801;&#x4E2D;&#x7684;&#x6CE8;&#x91CA;&#x5220;&#x9664;&#xFF0C;&#x8FD9;&#x91CC;&#x5E76;&#x4E0D;&#x4F1A;&#x68C0;&#x67E5;&#x8BED;&#x6CD5;
2&#xFF09;&#x7F16;&#x8BD1;&#xFF1A;&#x68C0;&#x67E5;&#x8BED;&#x6CD5;&#xFF0C;&#x5C06;&#x9884;&#x5904;&#x7406;&#x540E;&#x6587;&#x4EF6;&#x7F16;&#x8BD1;&#x751F;&#x6210;&#x6C47;&#x7F16;&#x6587;&#x4EF6;
3&#xFF09;&#x6C47;&#x7F16;&#xFF1A;&#x5C06;&#x6C47;&#x7F16;&#x6587;&#x4EF6;&#x751F;&#x6210;&#x76EE;&#x6807;&#x6587;&#x4EF6;(&#x4E8C;&#x8FDB;&#x5236;&#x6587;&#x4EF6;)
4&#xFF09;&#x94FE;&#x63A5;&#xFF1A;C&#x8BED;&#x8A00;&#x5199;&#x7684;&#x7A0B;&#x5E8F;&#x662F;&#x9700;&#x8981;&#x4F9D;&#x8D56;&#x5404;&#x79CD;&#x5E93;&#x7684;&#xFF0C;&#x6240;&#x4EE5;&#x7F16;&#x8BD1;&#x4E4B;&#x540E;&#x8FD8;&#x9700;&#x8981;&#x628A;&#x5E93;&#x94FE;&#x63A5;&#x5230;&#x6700;&#x7EC8;&#x7684;&#x53EF;&#x6267;&#x884C;&#x7A0B;&#x5E8F;&#x4E2D;&#x53BB;</p>
<h2 id="gcc&#x7F16;&#x8BD1;&#x8FC7;&#x7A0B;">gcc&#x7F16;&#x8BD1;&#x8FC7;&#x7A0B;</h2>
<p>&#x5206;&#x6B65;&#x7F16;&#x8BD1;
&#x9884;&#x5904;&#x7406;&#xFF1A;gcc -E hello.c -o hello.i
&#x7F16; &#x8BD1;&#xFF1A;gcc -S hello.i -o hello.s
&#x6C47; &#x7F16;&#xFF1A;gcc -c hello.s -o hello.o
&#x94FE; &#x63A5;&#xFF1A;gcc hello.o -o hello_elf  &#x94FE;&#x63A5;&#x5176;&#x4ED6;&#x5E93;&#x548C;&#x7CFB;&#x7EDF;&#x5E93;</p>
<p>&#x6587;&#x4EF6;&#x540E;&#x7F00;&#x542B;&#x4E49;
.c C &#x8BED;&#x8A00;&#x6587;&#x4EF6;
.i &#x9884;&#x5904;&#x7406;&#x540E;&#x7684; C &#x8BED;&#x8A00;&#x6587;&#x4EF6;
.s &#x7F16;&#x8BD1;&#x540E;&#x7684;&#x6C47;&#x7F16;&#x6587;&#x4EF6;
.o &#x7F16;&#x8BD1;&#x540E;&#x7684;&#x76EE;&#x6807;&#x6587;&#x4EF6;</p>
<h2 id="&#x67E5;&#x627E;&#x6267;&#x884C;&#x6587;&#x4EF6;&#x52A8;&#x6001;&#x5E93;">&#x67E5;&#x627E;&#x6267;&#x884C;&#x6587;&#x4EF6;&#x52A8;&#x6001;&#x5E93;</h2>
<p>linux&#xFF1A;ldd&#x67E5;&#x627E;&#x52A8;&#x6001;&#x5E93;</p>
<pre><code class="lang-shell">[kduser@v-k8s-smartpos v7pg]$ ldd main
linux-vdso.so.1 =&gt;  (0x00007fffe83ef000)
libc.so.6 =&gt; /lib64/libc.so.6 (0x00007f8d4c498000)
/lib64/ld-linux-x86-64.so.2 (0x00007f8d4c865000)
</code></pre>
<p>windows depends.exe&#x5E2E;&#x52A9;&#x67E5;&#x770B;
&#x4E0B;&#x8F7D;&#x5E2E;&#x52A9;&#x5DE5;&#x5177; depends.exe  <a href="http://www.dependencywalker.com/depends22_x86.zip" target="_blank">http://www.dependencywalker.com/depends22_x86.zip</a>
&#x5B98;&#x65B9;&#x7F51;&#x7AD9;&#xFF1A;<a href="http://www.dependencywalker.com/" target="_blank">http://www.dependencywalker.com/</a> 
&#x7F51;&#x76D8;&#x5206;&#x4EAB; <a href="https://pan.baidu.com/s/13a6zJ6uGHFqZw5eoua7YkQ" target="_blank">https://pan.baidu.com/s/13a6zJ6uGHFqZw5eoua7YkQ</a></p>
<h2 id="&#x7F16;&#x7A0B;&#x5DE5;&#x5177;clion">&#x7F16;&#x7A0B;&#x5DE5;&#x5177;CLion</h2>
<p>&#x4E0B;&#x8F7D;&#x5E76;&#x5B89;&#x88C5; Dev-Cpp &#x4F1A;&#x5F97;&#x5230;gcc&#x7F16;&#x8BD1;&#x73AF;&#x5883; MinGW64
jetBrains&#x5B98;&#x7F51;&#x4E0B;&#x8F7D;&#xFF0C;&#x6B63;&#x5E38;&#x5B89;&#x88C5;&#x5373;&#x53EF;</p>
<h2 id="&#x53C2;&#x8003;&#xFF1A;">&#x53C2;&#x8003;&#xFF1A;</h2>
<p>&#x94FE;&#x63A5;&#xFF1A;<a href="https://pan.baidu.com/s/1bG4dGhg2f7fIOncSgXGRFQ" target="_blank">https://pan.baidu.com/s/1bG4dGhg2f7fIOncSgXGRFQ</a> &#x63D0;&#x53D6;&#x7801;&#xFF1A;wvnc</p>
<h2 id="hello-world">Hello world</h2>
<p>&#x65B0;&#x5EFA;C99&#x9879;&#x76EE;&#xFF0C;&#x4F1A;&#x81EA;&#x52A8;&#x751F;&#x6210; main.c &#x6587;&#x4EF6;&#xFF0C;&#x5185;&#x5BB9;&#x5982;&#x4E0B;</p>
<pre><code class="lang-c"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio.h&gt;</span></span>

<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span> </span>{
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;Hello, World!\n&quot;</span>);
    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;
}
</code></pre>
<p>build&#x9879;&#x76EE;&#x540E;&#xFF0C;Run&#x5BF9;&#x5E94;&#x7684;&#x9879;&#x76EE;&#x5373;&#x53EF;</p>
<h2 id="&#x6570;&#x503C;&#x3001;&#x5B57;&#x7B26;&#x4E0E;&#x5B57;&#x7B26;&#x4E32;">&#x6570;&#x503C;&#x3001;&#x5B57;&#x7B26;&#x4E0E;&#x5B57;&#x7B26;&#x4E32;</h2>
<table>
<thead>
<tr>
<th style="text-align:center">-</th>
<th style="text-align:center">&#x7C7B;&#x578B;</th>
<th style="text-align:center">&#x63CF;&#x8FF0; </th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">&#x6570;&#x503C;</td>
<td style="text-align:center">int</td>
<td style="text-align:center">&#x5B58;&#x50A8;&#x6574;&#x6570;</td>
</tr>
<tr>
<td style="text-align:center">-</td>
<td style="text-align:center">float</td>
<td style="text-align:center">&#x6574;&#x6570;+&#x5C0F;&#x6570;</td>
</tr>
<tr>
<td style="text-align:center">-</td>
<td style="text-align:center">double</td>
<td style="text-align:center">&#x6574;&#x6570;+&#x5C0F;&#x6570;(&#x7CBE;&#x5EA6;&#x66F4;&#x9AD8;)</td>
</tr>
<tr>
<td style="text-align:center">&#x5B57;&#x7B26;</td>
<td style="text-align:center">char</td>
<td style="text-align:center">&#x5355;&#x4E2A;&#x5B57;&#x7B26;</td>
</tr>
<tr>
<td style="text-align:center">-</td>
<td style="text-align:center">&#x5B57;&#x7B26;&#x4E32;</td>
<td style="text-align:center">&#x4E00;&#x6BB5;&#x8FDE;&#x7EED;&#x7684;&#x5B57;&#x7B26;</td>
</tr>
</tbody>
</table>
<h2 id="&#x58F0;&#x660E;&#x65B9;&#x5F0F;">&#x58F0;&#x660E;&#x65B9;&#x5F0F;</h2>
<p>&#x6570;&#x636E;&#x7C7B;&#x578B; &#x53D8;&#x91CF;&#x540D;;</p>
<p>&#x4E3E;&#x4F8B;&#xFF1A; </p>
<pre><code class="lang-cpp"><span class="hljs-comment">// int&#x7C7B;&#x578B; int i; </span>
<span class="hljs-comment">/* &#x666E;&#x901A;&#x58F0;&#x660E; */</span> 
<span class="hljs-keyword">int</span> j,k; 
<span class="hljs-comment">/* &#x540C;&#x65F6;&#x58F0;&#x660E;&#x591A;&#x4E2A; */</span> 
<span class="hljs-keyword">int</span> age= <span class="hljs-number">18</span>; 
<span class="hljs-comment">/* &#x58F0;&#x660E;&#x7684;&#x540C;&#x65F6;&#x8D4B;&#x503C; */</span> 
<span class="hljs-keyword">int</span> Alan ,Sam=<span class="hljs-number">16</span>;<span class="hljs-comment">/* &#x58F0;&#x660E;&#x4E0E;&#x540C;&#x65F6;&#x8D4B;&#x503C; */</span> 
<span class="hljs-comment">// float&#x7C7B;&#x578B; float f; /* &#x666E;&#x901A;&#x58F0;&#x660E; */ </span>
<span class="hljs-keyword">float</span> q,money; <span class="hljs-comment">/* &#x540C;&#x65F6;&#x58F0;&#x660E;&#x591A;&#x4E2A; */</span> 
<span class="hljs-keyword">float</span> v = <span class="hljs-number">2.0</span>; <span class="hljs-comment">/* &#x58F0;&#x660E;&#x7684;&#x540C;&#x65F6;&#x8D4B;&#x503C; */</span> 
<span class="hljs-comment">// char&#x7C7B;&#x578B; </span>
<span class="hljs-keyword">char</span> c; <span class="hljs-comment">/*&#x666E;&#x901A;&#x58F0;&#x660E; */</span> 
<span class="hljs-keyword">char</span> zh,text; <span class="hljs-comment">/* &#x540C;&#x65F6;&#x58F0;&#x660E;&#x591A;&#x4E2A; */</span> 
<span class="hljs-keyword">char</span> letter = <span class="hljs-string">&apos;A&apos;</span>; 
<span class="hljs-comment">/* &#x58F0;&#x660E;&#x7684;&#x540C;&#x65F6;&#x8D4B;&#x503C; */</span> <span class="hljs-comment">// char&#x6570;&#x7EC4;(&#x5B57;&#x7B26;&#x4E32;) </span>
<span class="hljs-keyword">char</span> c[<span class="hljs-number">20</span>] = { <span class="hljs-string">&apos;H&apos;</span>,<span class="hljs-string">&apos;e&apos;</span>,<span class="hljs-string">&apos;l&apos;</span>,<span class="hljs-string">&apos;l&apos;</span>,<span class="hljs-string">&apos;o&apos;</span>,<span class="hljs-string">&apos; &apos;</span>,<span class="hljs-string">&apos;w&apos;</span>,<span class="hljs-string">&apos;o&apos;</span>,<span class="hljs-string">&apos;r&apos;</span>,<span class="hljs-string">&apos;l&apos;</span>,<span class="hljs-string">&apos;d&apos;</span> }; 
<span class="hljs-keyword">char</span> name[] = { <span class="hljs-string">&apos;A&apos;</span>, <span class="hljs-string">&apos;l&apos;</span>, <span class="hljs-string">&apos;a&apos;</span>, <span class="hljs-string">&apos;n&apos;</span> };
</code></pre>
<h2 id="&#x8F6C;&#x4E49;&#x5B57;&#x7B26;">&#x8F6C;&#x4E49;&#x5B57;&#x7B26;</h2>
<p>&#x5728;&#x4E00;&#x6BB5;&#x5B57;&#x7B26;&#x4E32;&#x4E2D;&#xFF0C;&#x4E0D;&#x80FD;&#x76F4;&#x63A5;&#x51FA;&#x73B0;&#xFF0C;&#x9700;&#x8981;&#x8F6C;&#x4E49;&#x7684;&#x5B57;&#x7B26;&#xFF0C;&#x4F8B;&#x5982;&#xFF1A;</p>
<p>&apos;\n&apos; &#x6362;&#x884C; &apos;\t&apos;&apos; &#x6C34;&#x5E73;&#x5236;&#x8868; &apos;\&apos;&apos; &#x5355;&#x5F15;&#x53F7; &apos;\&quot;&apos; &#x53CC;&#x5F15;&#x53F7; &apos;\&apos; &#x53CD;&#x659C;&#x6760;</p>
<pre><code class="lang-c"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span><span class="hljs-meta-string">&lt;stdio.h&gt;</span></span>
main()
{
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;Num\tName\n&quot;</span>);
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;001\tAlan\n&quot;</span>);
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;002\tLellansin\n&quot;</span>);
}
</code></pre>
<p>&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#xFF1A;</p>
<pre><code class="lang-shell">Num&#x3000;&#x3000;&#x3000;Name
001&#x3000;&#x3000;&#x3000;Alan
002&#x3000;&#x3000;&#x3000;Lellansin
</code></pre>
<h2 id="printf&#x4E0E;scanf">printf&#x4E0E;scanf</h2>
<p>printf &#x6253;&#x5370;&#xFF0C;scanf &#x4E3A;&#x8F93;&#x5165;</p>
<p>&#x5F62;&#x5F0F;</p>
<pre><code class="lang-c"><span class="hljs-built_in">printf</span>(&#x5B57;&#x7B26;&#x4E32;&#xFF0C;... ); <span class="hljs-comment">// &#x70B9;&#x70B9;&#x70B9;&#x4E3A;&#x591A;&#x4E2A;&#x53C2;&#x6570;</span>
<span class="hljs-built_in">scanf</span>(&#x5B57;&#x7B26;&#x4E32;&#xFF0C;... );
</code></pre>
<h2 id="&#x5360;&#x4F4D;&#x7B26;">&#x5360;&#x4F4D;&#x7B26;</h2>
<p>&#x5BF9;&#x4E8E; printf &#x8F93;&#x51FA;&#x7684;&#x60C5;&#x51B5;&#x800C;&#x8A00;&#xFF0C;&#x5360;&#x4F4D;&#x7B26;&#x7684;&#x610F;&#x601D;&#x662F;&#x5148;&#x5360;&#x4E2A;&#x4F4D;&#x7F6E;&#x7684;&#x7B26;&#x53F7;&#xFF0C;&#x81F3;&#x4E8E;&#x8FD9;&#x4E2A;&#x4F4D;&#x7F6E;&#x5C06;&#x6765;&#x4F1A;&#x653E;&#x4EC0;&#x4E48;
&#x8FD8;&#x4E0D;&#x786E;&#x5B9A;&#xFF0C;&#x53EA;&#x80FD;&#x5148;&#x786E;&#x5B9A;&#x662F;&#x5360;&#x4F4D;&#x7B26;&#x6240;&#x6307;&#x660E;&#x7684;&#x7C7B;&#x578B;&#xFF0C;&#x5177;&#x4F53;&#x7684;&#x503C;&#x8FD8;&#x8981;&#x7B49;&#x7A0D;&#x540E;&#x7684;&#x53C2;&#x6570;&#x4E2D;&#x8865;&#x5145;&#x3002;&#x5BF9;&#x4E8E;
scanf &#x6765;&#x8BF4;&#xFF0C;&#x5219;&#x662F;&#x76F8;&#x53CD;&#x7684;&#x60C5;&#x51B5;&#x3002;</p>
<p>&#x5E38;&#x89C1;&#x683C;&#x5F0F;&#xFF1A;
%d &#x3000;&#x3000;&#x5341;&#x8FDB;&#x5236;&#x6574;&#x6570; %i &#x3000;&#x3000;&#x5341;&#x8FDB;&#x5236;&#x6574;&#x6570; %c &#x3000;&#x3000;&#x5355;&#x4E2A;&#x5B57;&#x7B26; %s &#x3000;&#x3000;&#x5B57;&#x7B26;&#x4E32; %f &#x3000;&#x3000;&#x6D6E;&#x70B9;&#x6570;</p>
<p>&#x5982;&#xFF1A;</p>
<pre><code class="lang-c"><span class="hljs-comment">// &#x8F93;&#x51FA;&#x5B57;&#x7B26;&#x4E32;&#x8981;&#x8F93;&#x51FA;&#x7684;&#x5E74;&#x9F84;&#x5C1A;&#x672A;&#x786E;&#x5B9E;&#x503C;&#x77E5;&#x9053;&#x662F; %d &#x5341;&#x8FDB;&#x5236;&#x6574;&#x6570;&#x7C7B;&#x578B;,</span>
<span class="hljs-comment">// &#x5177;&#x4F53;&#x8F93;&#x51FA;&#x6765;&#x662F;&#x4EC0;&#x4E48;&#x503C;&#x5219;&#x770B;&#x540E;&#x9762; age &#x7684;&#x5177;&#x4F53;&#x503C;</span>
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;Alan&#x7684;&#x5E74;&#x9F84;&#x662F;%d&quot;</span>, age);
<span class="hljs-comment">// &#x63A5;&#x624B;&#x7528;&#x6237;&#x8F93;&#x5165;&#x7684;&#x4E00;&#x4E2A;&#x5341;&#x8FDB;&#x5236;&#x6574;&#x6570;&#xFF0C;&#x6CE8;&#x610F;&#x8F93;&#x5165;&#x662F;&#x8981;&#x52A0; &amp; &#x7B26;&#x53F7;</span>
<span class="hljs-comment">// &#x5982;&#x679C;&#x7528;&#x6237;&#x8F93;&#x5165; 10.2 &#x5219;&#x5B58;&#x5165;&#x53D8;&#x91CF;i&#x4E2D;&#x7684;&#x503C;&#x662F; 10&#xFF0C;&#x56E0;&#x4E3A;&#x683C;&#x5F0F;&#x662F;&#x5341;&#x8FDB;&#x5236;&#x6574;&#x6570;</span>
<span class="hljs-built_in">scanf</span>(<span class="hljs-string">&quot;%d&quot;</span>, &amp;i);
</code></pre>
<p>&#x4E3E;&#x4F8B;&#xFF1A;</p>
<pre><code class="lang-c"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span><span class="hljs-meta-string">&lt;stdio.h&gt;</span></span>
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>
</span>{
<span class="hljs-keyword">int</span> age;
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x4F60;&#x7684;&#x5E74;&#x9F84;&#x662F;&#xFF1F;\n&quot;</span>);
<span class="hljs-built_in">scanf</span>(<span class="hljs-string">&quot;%d&quot;</span>,&amp;age); <span class="hljs-comment">// &#x8F93;&#x5165;&#x65F6;&#x53D8;&#x91CF;&#x524D;&#x52A0;&#x4E0A; &#x201C;&amp;&#x201D; &#x7B26;&#x53F7;</span>
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x4F60;&#x7684;&#x5E74;&#x9F84;&#x662F;%d&quot;</span>,age);
}
</code></pre>
<h2 id="&#x8FD0;&#x7B97;&#x7B26;&#x4EE5;&#x53CA;&#x8868;&#x8FBE;&#x5F0F;">&#x8FD0;&#x7B97;&#x7B26;&#x4EE5;&#x53CA;&#x8868;&#x8FBE;&#x5F0F;</h2>
<pre><code class="lang-c"><span class="hljs-comment">// &#x7B97;&#x672F;&#x8FD0;&#x7B97;&#x7B26;</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio.h&gt;</span></span>
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>
</span>{
<span class="hljs-keyword">int</span> i = <span class="hljs-number">7</span>, j = <span class="hljs-number">8</span>;
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;i+j=%d\n&quot;</span>, i + j ); <span class="hljs-comment">//15</span>
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;i-j=%d\n&quot;</span>, i - j ); <span class="hljs-comment">//0</span>
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;i*j=%d\n&quot;</span>, i * j ); <span class="hljs-comment">//56</span>
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;i/j=%d\n&quot;</span>, i / j ); <span class="hljs-comment">//0</span>
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;i%%j=%d\n&quot;</span>, i % j );<span class="hljs-comment">//7</span>
i++;
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;i++&#x540E;i&#x7684;&#x503C;&#x4E3A;%d\n&quot;</span>,i); <span class="hljs-comment">//8</span>
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;++i&#x540E;i&#x7684;&#x503C;&#x4E3A;%d\n&quot;</span>,++i);<span class="hljs-comment">//9</span>
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;j--&#x540E;j&#x7684;&#x503C;&#x4E3A;%d\n&quot;</span>,j--);<span class="hljs-comment">//8</span>
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;--j&#x540E;j&#x7684;&#x503C;&#x4E3A;%d\n&quot;</span>,--j);<span class="hljs-comment">//6</span>
}
<span class="hljs-comment">// &#x5173;&#x7CFB;&#x4E0E;&#x903B;&#x8F91;&#x8FD0;&#x7B97;&#x7B26;</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio.h&gt;</span></span>
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>
</span>{
<span class="hljs-keyword">int</span> Alan = <span class="hljs-number">18</span>, Sam = <span class="hljs-number">18</span>, Jack = <span class="hljs-number">16</span>;
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;%d\n&quot;</span>, Alan &gt; Jack ); <span class="hljs-comment">// 1</span>
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;%d\n&quot;</span>, Sam &lt; Jack ); <span class="hljs-comment">// 0</span>
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;%d\n&quot;</span>, Alan != Sam ); <span class="hljs-comment">// 0</span>
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;%d\n&quot;</span>, Alan == Sam ); <span class="hljs-comment">// 1</span>
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;%d\n&quot;</span>, Alan &gt;= Sam ); <span class="hljs-comment">// 1</span>
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;%d\n&quot;</span>, (Sam&gt;Jack) &amp;&amp; (Sam&gt;Jack) ); <span class="hljs-comment">//1</span>
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;%d\n&quot;</span>, Alan &gt; Jack );<span class="hljs-comment">//1</span>
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;%d\n&quot;</span>, ! Sam ); <span class="hljs-comment">//0</span>
}
<span class="hljs-comment">/*
&#x6570;&#x636E;&#x7C7B;&#x578B;&#x8F6C;&#x6362;
&#x5F62;&#x5F0F;&#xFF1A;
(&#x7C7B;&#x578B;) (&#x8868;&#x8FBE;&#x5F0F;)
*/</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio.h&gt;</span></span>
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>
</span>{
<span class="hljs-keyword">int</span> chinese, math, english, sum;
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x8BF7;&#x8F93;&#x5165;&#x8BED;&#x6570;&#x82F1;&#x4E09;&#x79D1;&#x7684;&#x6210;&#x7EE9;&#xFF1A;(&#x4EE5;&#x7A7A;&#x683C;&#x9694;&#x5F00;)\n&quot;</span>);
<span class="hljs-built_in">scanf</span>(<span class="hljs-string">&quot;%d%d%d&quot;</span>, &amp;chinese, &amp;math, &amp;english);
sum = (chinese + math + english);
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x5E73;&#x5747;&#x5206;&#x4E3A;%d\n&quot;</span>, sum/<span class="hljs-number">3</span>);
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x5E73;&#x5747;&#x5206;&#x4E3A;%f\n&quot;</span>, (<span class="hljs-keyword">float</span>)sum/<span class="hljs-number">3</span>);
}
<span class="hljs-comment">//&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x662F;&#x201C;=&#x201D;&#x4E0E;&#x201C;==&#x201D;&#x4E4B;&#x95F4;&#x7684;&#x533A;&#x522B;&#xFF1A; &#x201C;=&#x201D;&#x662F;&#x8D4B;&#x503C;&#x8FD0;&#x7B97; &#x201C;==&#x201D;&#x662F;&#x903B;&#x8F91;&#x8FD0;&#x7B97;</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio.h&gt;</span></span>
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>
</span>{
<span class="hljs-keyword">int</span> i = <span class="hljs-number">5</span>, b = <span class="hljs-number">10</span>;
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot; a=b &#x503C;&#x4E3A; %d\n&quot;</span>, a = b ); <span class="hljs-comment">//10</span>
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;a==b &#x503C;&#x4E3A; %d\n&quot;</span>, a == b); <span class="hljs-comment">//0</span>
}
</code></pre>
<h2 id="&#x6D41;&#x7A0B;&#x63A7;&#x5236;">&#x6D41;&#x7A0B;&#x63A7;&#x5236;</h2>
<h3 id="&#x9009;&#x62E9;&#x7ED3;&#x6784;">&#x9009;&#x62E9;&#x7ED3;&#x6784;</h3>
<p>1.if() else
2.switch() case:</p>
<h3 id="&#x5FAA;&#x73AF;&#x7ED3;&#x6784;">&#x5FAA;&#x73AF;&#x7ED3;&#x6784;</h3>
<p>1.while() &#x5FAA;&#x73AF;
2.do while() &#x5FAA;&#x73AF;
3.for() &#x5FAA;&#x73AF;</p>
<blockquote>
<p><strong>&#x7EC8;&#x6B62;&#x5FAA;&#x73AF;</strong>&#xFF1A; 1.continue &#x7EC8;&#x6B62;&#x8BE5;&#x6B21;&#x5FAA;&#x73AF; 2.break &#x7EC8;&#x6B62;&#x8BE5;&#x5FAA;&#x73AF;</p>
</blockquote>
<h2 id="if-else">if else</h2>
<pre><code class="lang-c"><span class="hljs-comment">// &#x5F62;&#x5F0F;1</span>
<span class="hljs-keyword">if</span>(&#x6761;&#x4EF6;)
{ <span class="hljs-comment">/*&#x6761;&#x4EF6;&#x4E3A;&#x771F;&#x6267;&#x884C;*/</span>
...
}
<span class="hljs-comment">// &#x5F62;&#x5F0F;2</span>
<span class="hljs-keyword">if</span>(&#x6761;&#x4EF6;)
{ <span class="hljs-comment">/*&#x6761;&#x4EF6;&#x4E3A;&#x771F;&#x6267;&#x884C;*/</span>
...
}<span class="hljs-keyword">else</span>
{ <span class="hljs-comment">/*&#x6761;&#x4EF6;&#x4E3A;&#x5047;&#x6267;&#x884C;*/</span>
...
}
<span class="hljs-comment">// &#x66F4;&#x591A;&#x5F62;&#x5F0F;..</span>
<span class="hljs-keyword">if</span>(&#x6761;&#x4EF6;<span class="hljs-number">1</span>)
{ <span class="hljs-comment">/*&#x6761;&#x4EF6;1&#x4E3A;&#x771F;&#x6267;&#x884C;*/</span>
...
}<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span>(&#x6761;&#x4EF6;<span class="hljs-number">2</span>)
{ <span class="hljs-comment">/*&#x6761;&#x4EF6;2&#x4E3A;&#x771F;&#x6267;&#x884C;*/</span>
...
}<span class="hljs-keyword">else</span>
{ <span class="hljs-comment">/*&#x6761;&#x4EF6;1&#x3001;2&#x4E3A;&#x5047;&#x624D;&#x6267;&#x884C;*/</span>
...
}
</code></pre>
<p>&#x4EE3;&#x7801;&#x793A;&#x4F8B;</p>
<pre><code class="lang-c"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio.h&gt;</span></span>
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>
</span>{
    <span class="hljs-keyword">int</span> salary = <span class="hljs-number">2500</span>;
    <span class="hljs-keyword">int</span> rent = <span class="hljs-number">850</span>;
    <span class="hljs-keyword">int</span> life_cost = <span class="hljs-number">1000</span>;
    <span class="hljs-keyword">if</span>( salary &gt; (rent + life_cost) )
    {
        <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x8FD8;&#x8FC7;&#x7684;&#x4E0B;&#x53BB;&quot;</span>);
    }<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span>( salary &lt; (rent + life_cost) )
    {
        <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x6D3B;&#x4E0D;&#x4E0B;&#x53BB;&#x4E86;&#xFF01;&quot;</span>);
    }<span class="hljs-keyword">else</span>
    {
        <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x5988;&#x7684;&#xFF01;&quot;</span>);
    }
}
</code></pre>
<h2 id="switch">switch</h2>
<pre><code class="lang-c"><span class="hljs-keyword">switch</span>(&#x53D8;&#x91CF;)
{
<span class="hljs-keyword">case</span> &#x60C5;&#x51B5;<span class="hljs-number">1</span> :
...
<span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> &#x60C5;&#x51B5;<span class="hljs-number">2</span> :
...
<span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> &#x60C5;&#x51B5;<span class="hljs-number">3</span> :
...
<span class="hljs-keyword">break</span>;
<span class="hljs-keyword">default</span> : <span class="hljs-comment">/* &#x9ED8;&#x8BA4;&#x60C5;&#x51B5; */</span>
...
}
</code></pre>
<p>&#x4EE3;&#x7801;&#x793A;&#x4F8B;</p>
<pre><code class="lang-c"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio.h&gt;</span></span>
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>
</span>{
<span class="hljs-keyword">char</span> cmd;
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x786E;&#x8BA4;&#x8981;&#x5220;&#x9664;&#x5417;&#xFF1F;&quot;</span>);
<span class="hljs-built_in">scanf</span>(<span class="hljs-string">&quot;%c&quot;</span>, cmd);
<span class="hljs-keyword">switch</span>(cmd)
{
<span class="hljs-keyword">case</span> <span class="hljs-string">&apos;Y&apos;</span>:
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x6587;&#x4EF6;&#x6B63;&#x5728;&#x5220;&#x9664;\n&quot;</span>);
<span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> <span class="hljs-string">&apos;N&apos;</span>:
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x53D6;&#x6D88;&#x5220;&#x9664;\n&quot;</span>);
<span class="hljs-keyword">break</span>;
defualt:
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x7528;&#x6237;&#x672A;&#x54CD;&#x5E94;&#xFF0C;&#x64CD;&#x4F5C;&#x53D6;&#x6D88;\n&quot;</span>);
}
}
</code></pre>
<p>&#x5173;&#x4E8E;case&#x7A7F;&#x900F;</p>
<pre><code class="lang-c"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio.h&gt;</span></span>
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>
</span>{
    <span class="hljs-keyword">int</span> score = <span class="hljs-number">80</span>;
    <span class="hljs-keyword">switch</span>(math/<span class="hljs-number">10</span>)
    {
        <span class="hljs-keyword">case</span> <span class="hljs-number">1</span>:
        <span class="hljs-keyword">case</span> <span class="hljs-number">2</span>:
        <span class="hljs-keyword">case</span> <span class="hljs-number">3</span>:
        <span class="hljs-keyword">case</span> <span class="hljs-number">4</span>:
        <span class="hljs-keyword">case</span> <span class="hljs-number">5</span>:
            <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x4E0D;&#x53CA;&#x683C;\n&quot;</span>);
        <span class="hljs-keyword">case</span> <span class="hljs-number">6</span>:
        <span class="hljs-keyword">case</span> <span class="hljs-number">7</span>:
        <span class="hljs-keyword">case</span> <span class="hljs-number">8</span>:
            <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x53CA;&#x683C;\n&quot;</span>);
        <span class="hljs-keyword">case</span> <span class="hljs-number">9</span>:
        <span class="hljs-keyword">case</span> <span class="hljs-number">10</span>:
            <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x6EE1;&#x5206;\n&quot;</span>);
    }
}
<span class="hljs-comment">//case&#x8BED;&#x53E5;&#x540E;&#x9762;&#x52A0;break&#x624D;&#x4F1A;&#x8DF3;&#x51FA;&#x63A7;&#x5236;&#x6D41;&#x7A0B;</span>
</code></pre>
<h2 id="&#x5FAA;&#x73AF;">&#x5FAA;&#x73AF;</h2>
<pre><code class="lang-c"><span class="hljs-comment">//while &#x5FAA;&#x73AF;</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio.h&gt;</span></span>
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>
</span>{
    <span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>;
    <span class="hljs-keyword">while</span>(i &lt; <span class="hljs-number">10</span>)
    {
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;%d &quot;</span>, i);
    }
}
<span class="hljs-comment">//do while &#x5FAA;&#x73AF;</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio.h&gt;</span></span>
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>
</span>{
    <span class="hljs-keyword">char</span> c;
    <span class="hljs-keyword">do</span>
    {
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x8BF7;&#x95EE;&#x4F60;&#x662F;&#x2468;&#x5417;&#xFF1F;(Y/N)\n&quot;</span>)
    <span class="hljs-built_in">scanf</span>(<span class="hljs-string">&quot;%c&quot;</span>, &amp;c);
    }<span class="hljs-keyword">while</span>( c != <span class="hljs-string">&apos;Y&apos;</span>);
}
<span class="hljs-comment">//for &#x5FAA;&#x73AF;</span>
<span class="hljs-comment">// &#x5F62;&#x5F0F;</span>
<span class="hljs-comment">// for( &#x521D;&#x59CB;&#x503C;; &#x6761;&#x4EF6;; &#x53D8;&#x5316; )</span>
<span class="hljs-comment">// {</span>
<span class="hljs-comment">// ...</span>
<span class="hljs-comment">// }</span>
<span class="hljs-comment">//&#x793A;&#x4F8B;:</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio.h&gt;</span></span>
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>
</span>{
    <span class="hljs-keyword">int</span> i;
    <span class="hljs-keyword">for</span>( i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">10</span>; i++ )
    {
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;%d\n&quot;</span>, i);
    }
}
<span class="hljs-comment">//continue&#x4E0E;break</span>
<span class="hljs-comment">//&#x7EC8;&#x6B62;&#x5FAA;&#x73AF;&#xFF1A; 1.continue &#x7EC8;&#x6B62;&#x8BE5;&#x6B21;&#x5FAA;&#x73AF; 2.break &#x7EC8;&#x6B62;&#x8BE5;&#x5FAA;&#x73AF;</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span></span>
main()
{
    <span class="hljs-keyword">int</span> i;
    <span class="hljs-keyword">for</span>( i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">10</span>; i++)
    {
        <span class="hljs-keyword">if</span>( i == <span class="hljs-number">3</span> )
            <span class="hljs-keyword">continue</span>;
            <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;%d &quot;</span>, i);
    }
}
</code></pre>
<h2 id="&#x79FB;&#x4F4D;&#x8BA1;&#x7B97;">&#x79FB;&#x4F4D;&#x8BA1;&#x7B97;</h2>
<p>X&lt;<n=x*2^n x="">&gt;n=X/2^n</n=x*2^n></p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="2020-01-07-c语言.html" class="navigation navigation-prev " aria-label="Previous page: 1.2020-01-07-c语言">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="2020-01-09-c语言语法基础.html" class="navigation navigation-next " aria-label="Next page: 3.2020-01-09-c语言语法基础">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"layout":"post","title":"2.2020-01-07-C语言基础教程","categories":["C","c","c语言"],"description":"C语言基础教程","keywords":"C, c,c语言","level":"2.2.2","depth":2,"next":{"title":"3.2020-01-09-c语言语法基础","level":"2.2.3","depth":2,"path":"c/2020-01-09-c语言语法基础.md","ref":"c/2020-01-09-c语言语法基础.md","articles":[]},"previous":{"title":"1.2020-01-07-c语言","level":"2.2.1","depth":2,"path":"c/2020-01-07-c语言.md","ref":"c/2020-01-07-c语言.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"c/2020-01-07-C语言基础教程.md","mtime":"2020-01-10T06:25:00.418Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-08-27T08:51:05.639Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

